<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>

    <body>
        <script>
            // 请通过遍历的方式将以下数组中的0删除
            let num = [1, 2, 0, 3, 0, 4, 0, 0, 0, 5, 6, 7, 8, 9];

            for (let i = num.length; i > 0; i--) {
                if (num[i] === 0) {
                    num.splice(i, 1);
                }
            }

            document.write(num);
        </script>
    </body>
</html>
